import request from '@/config/axios'

// 文件存储 VO
export interface UploadJsonVO {
  fileId: number // 文件ID
  fileName: string // 文件名
  filePath: string // 存储路径
  fileSize: number // 文件大小
  uploadTime: Date // 上传时间
}

// 文件存储 API
export const UploadJsonApi = {
  // 查询文件存储分页
  getUploadJsonPage: async (params: any) => {
    return await request.get({ url: `/energy/upload-json/page`, params })
  },

  // 查询文件存储详情
  getUploadJson: async (id: number) => {
    return await request.get({ url: `/energy/upload-json/get?id=` + id })
  },

  // 新增文件存储
  createUploadJson: async (data: UploadJsonVO) => {
    return await request.post({ url: `/energy/upload-json/create`, data })
  },

  // 修改文件存储
  updateUploadJson: async (data: UploadJsonVO) => {
    return await request.put({ url: `/energy/upload-json/update`, data })
  },

  // 删除文件存储
  deleteUploadJson: async (id: number) => {
    return await request.delete({ url: `/energy/upload-json/delete?id=` + id })
  },

  // 导出文件存储 Excel
  exportUploadJson: async (params) => {
    return await request.download({ url: `/energy/upload-json/export-excel`, params })
  },
}